package com.liujit.bms.app.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.liujit.bms.app.domain.model.BlogArticle;
import com.liujit.bms.app.domain.query.BlogArticleQuery;
import com.liujit.bms.app.domain.query.BlogTimeArchiveQuery;
import com.liujit.bms.app.domain.result.BlogArticleResult;
import com.liujit.bms.app.domain.result.BlogLabelResult;
import com.liujit.bms.app.domain.result.BlogTimeArchiveResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Description 博客文章Mapper
 * @Author liujun
 * @Date 2021-07-13 11:11:02
 */
@Mapper
public interface BlogArticleMapper extends BaseMapper<BlogArticle> {

    /**
     * 分页查询博客列表
     *
     * @param page
     * @param query
     * @return
     * @author: liujun
     * @date: 2021/7/13 2:17 下午
     */
    IPage<BlogArticleResult> selPage(Page<BlogArticleResult> page, @Param("query") BlogArticleQuery query);

    /**
     * 根据博客文章id，查询标签
     *
     * @param params
     * @return
     * @author: liujun
     * @date: 2021/7/14 8:28 上午
     */
    List<BlogLabelResult> selLabelByArticleId(Map<String, Object> params);

    /**
     * 根据博客文章时间归档查询条件，查询时间归档列表
     *
     * @param query 博客文章时间归档查询条件
     * @return 时间归档列表
     * @author: liujun
     * @date: 2021/7/13 4:47 下午
     */
    List<BlogTimeArchiveResult> selTimeArchive(BlogTimeArchiveQuery query);
}